{% extends "layout.html" %}

{% load history_tags %}
{% load i18n %}

{% block title %}
    {% trans "All reviews" %} | {{ product.title }} | {{ block.super }}
{% endblock %}

{% block breadcrumbs %}
    <ul class="breadcrumb">
        <li>
            <a href="{{ homepage_url }}">{% trans "Home" %}</a>
        </li>
        {% with category=product.categories.all.0 %}
            {% for c in category.get_ancestors_and_self %}
                <li>
                    <a href="{{ c.get_absolute_url }}">{{ c.name }}</a>
                </li>
            {% endfor %}
            <li>
                <a href="{{ product.get_absolute_url }}">{{ product.title }}</a>
            </li>
        {% endwith %}
        <li class="active">{% trans "All reviews" %}</li>
    </ul>
{% endblock %}

{% block headertext %}
    {% trans "Customer reviews" %}
{% endblock  %}

{% block content %}

    <section>        
        {% include 'catalogue/reviews/review_product.html' %}

        {% if reviews %}
            <form method="get" class="form-inline">
                {% for field in form %}
                    {{ field.label }}
                    {{ field }}
                {% endfor %}
                <input type="submit" class="btn btn-default" value="{% trans "Go" %}" />
            </form>

            {% for review in reviews %}
                {% include 'catalogue/partials/review.html' %}
            {% endfor %}
            {% include 'partials/pagination.html' %}

        {% else %}
            <p>{% trans "This product does not have any reviews yet." %}</p>
        {% endif %}

    </section>
{% endblock %}
